package org.example.bifunction;

import com.alibaba.fastjson.JSONObject;

import java.util.Arrays;
import java.util.List;
import java.util.function.BiFunction;

public class Java8BiFunction1 {
    public static void main(String[] args) {
        BiFunction<Integer,Integer,Integer> func = Integer::sum;
        System.err.println(func.apply(2, 3));
        BiFunction<Integer,Integer,Double> func2 = Math::pow;
        System.err.println(func2.apply(2, 4));
        BiFunction<Integer,Integer, List<Integer>> func3 = (x1,x2) -> Arrays.asList(x1 + x2);
        System.err.println(JSONObject.toJSONString(func3.apply(2,3),true));
    }
}
